<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>hello react</title>
</head>
<body>
    <div id="root"></div>
    <div id="app"></div>
    <!-- 添加依赖 -->
    <!-- 依赖三个包 -->
    <!-- cdn引入 -->
    <script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin></script>
    <script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" crossorigin></script>
    <!-- babel -->
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>

    <script type="text/babel">
        //编写react代码 jsx语法
        // JSX语法 ->普通的Javascript代码 ->babel
        //渲染hello world
        // react18之前 reactDOM.render
        // ReactDOM.render(<h2> hello world</h2>,document.querySelector("#root"))

        // react18之后:
        const root = ReactDOM.createRoot(document.querySelector("#root"))
        const app = ReactDOM.createRoot(document.querySelector("#app"))
        root.render(<h2>hello world </h2>)
        app.render(<h2>你好啊</h2>)
    </script>
</body>
</html>